﻿using BootstrapBlazor.Components;
using BootstrapBlazorApp.Shared.Data.SYS;
using BootstrapBlazorApp.Shared.Shared;
using WebApiClientCore;
using WebApiClientCore.Attributes;

namespace BootstrapBlazorApp.Shared.Services
{
    [TokenFilter]
    public interface ISysApi : IHttpApi
    {
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/login")]
        ITask<ResponseModel<TokenModel>> LoginAsync([JsonContent]LoginModel input);

        /// <summary>
        /// 三方登录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/ThreeLoginAsync")]
        Task<ResponseModel<TokenModel>> ThreeLoginAsync([JsonContent] LoginModel input);


        #region 用户
        /// <summary>
        /// 新增用户
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/AddUser")]
        ITask<ResponseModel> AddUser([JsonContent] UserDto input);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/DeleteMutiUserAsync")]
        ITask<ResponseModel> DeleteMutiUserAsync([JsonContent] List<UserDto> input);

        /// <summary>
        /// 修改用户
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/UpdateUserAsync")]
        ITask<ResponseModel> UpdateUserAsync([JsonContent] UserDto input);

        /// <summary>
        /// 查询用户
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/QueryUserAsync")]
        ITask<ResponseModel<QueryData<UserDto>>> QueryUserAsync([JsonContent] QueryParameter options);
        #endregion

        #region 角色
        /// <summary>
        /// 新增角色
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/AddRoleAsync")]
        ITask<ResponseModel> AddRoleAsync([JsonContent] RoleDto input);

        /// <summary>
        /// 删除角色
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/DeleteMutiRoleAsync")]
        ITask<ResponseModel> DeleteMutiRoleAsync([JsonContent] List<RoleDto> input);

        /// <summary>
        /// 修改角色
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/UpdateRoleAsync")]
        ITask<ResponseModel> UpdateRoleAsync([JsonContent] RoleDto input);

        /// <summary>
        /// 查询角色
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/QueryRoleAsync")]
        ITask<ResponseModel<QueryData<RoleDto>>> QueryRoleAsync([JsonContent] QueryParameter options);
        #endregion


        #region 数据字典
        /// <summary>
        /// 新增数据字典
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/AddDictionaryAsync")]
        ITask<ResponseModel> AddDictionaryAsync([JsonContent] DictionaryDto input);

        /// <summary>
        /// 更新数据字典
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/UpdateDictionaryAsync")]
        ITask<ResponseModel> UpdateDictionaryAsync([JsonContent] DictionaryDto input);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/DeleteMutiDictionaryAsync")]
        ITask<ResponseModel> DeleteMutiDictionaryAsync([JsonContent] List<DictionaryDto> input);

        /// <summary>
        /// 查询数据字典
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/QueryDictionaryAsync")]
        ITask<ResponseModel<QueryData<DictionaryDto>>> QueryDictionaryAsync([JsonContent] QueryParameter input);

        /// <summary>
        /// 查询根据类别
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/QueryDictionaryByTypeAsync/{input}")]
        Task<ResponseModel<List<SelectedItem>>> QueryDictionaryByTypeAsync([Uri]string input);

        #endregion


        #region 菜单
        /// <summary>
        /// 新增菜单
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/AddMenuAsync")]
        ITask<ResponseModel> AddMenuAsync([JsonContent] MenuDto input);

        /// <summary>
        /// 更新菜单
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/UpdateMenuAsync")]
        ITask<ResponseModel> UpdateMenuAsync([JsonContent] MenuDto input);

        /// <summary>
        /// 删除菜单
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/DeleteMutiMenuAsync")]
        ITask<ResponseModel> DeleteMutiMenuAsync([JsonContent] List<MenuDto> input);

        /// <summary>
        /// 查询菜单
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/QueryMenuAsync")]
        ITask<ResponseModel<List<MenuDto>>> QueryMenuAsync();

        /// <summary>
        /// 查询按钮权限
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/QueryButtonsByAccountAsync")]
        Task<ResponseModel<List<MenuDto>>> QueryButtonsByAccountAsync(string Account);

        /// <summary>
        /// 查询菜单
        /// </summary>
        /// <returns></returns>
        [HttpPost("api/system/QueryMenusByAccountAsync")]
        Task<ResponseModel<List<MenuItem>>> QueryMenusByAccountAsync(string Account, string AppCode);
        #endregion


        #region 用户角色
        /// <summary>
        /// 新增用户角色
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/AddUserRoleAsync")]
        ITask<ResponseModel> AddUserRoleAsync([JsonContent] UserRoleDto input);

        /// <summary>
        /// 更新用户角色
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/UpdateUserRoleAsync")]
        ITask<ResponseModel> UpdateUserRoleAsync([JsonContent] UserRoleDto input);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/DeleteMutiUserRoleAsync")]
        ITask<ResponseModel> DeleteMutiUserRoleAsync([JsonContent] List<UserRoleDto> input);

        /// <summary>
        /// 查询用户角色
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/QueryUserRoleAsync")]
        ITask<ResponseModel<QueryData<UserRoleDto>>> QueryUserRoleAsync([JsonContent] QueryParameter input);
        #endregion

        #region 角色菜单
        /// <summary>
        /// 新增角色菜单
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/AddRoleMenuAsync")]
        ITask<ResponseModel> AddRoleMenuAsync([JsonContent] RoleMenuDto input);

        /// <summary>
        /// 更新角色菜单
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/UpdateRoleMenuAsync")]
        ITask<ResponseModel> UpdateRoleMenuAsync([JsonContent] RoleMenuDto input);

        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/DeleteMutiRoleMenuAsync")]
        ITask<ResponseModel> DeleteMutiRoleMenuAsync([JsonContent] List<RoleMenuDto> input);

        /// <summary>
        /// 查询角色菜单
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("api/system/QueryRoleMenuAsync")]
        ITask<ResponseModel<QueryData<RoleMenuDto>>> QueryRoleMenuAsync([JsonContent] QueryParameter input);


        [HttpPost("api/system/QueryMenusByRoleCodeAsync")]
        ITask<ResponseModel<List<MenuDto>>> QueryMenusByRoleCodeAsync(string RoleCode);
        #endregion
    }
}
